﻿using EmoneyWeiXinEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using EmoneyWeiXinCommon;

namespace EmoneyWeiXinDAL
{
    public class RedBagDAL
    {
        public static int Insert(RedBagEntity entity)
        {
            string sql = "INSERT INTO RedBag(weixinId,openId,ActivityId,ActivityName,t_Money,isLock,isGetted,createTime,isEnable) values(@weixinId,@openId,@ActivityId,@ActivityName,@t_Money,isLock,@isGetted,@createTime,@isEnable)";
            SqlParameter[] paras =
         {
            new SqlParameter("@weixinId",entity.weixinId),
            new SqlParameter("@openId",entity.openId),
            new SqlParameter("@ActivityId",entity.ActivityId),
            new SqlParameter("@ActivityName",entity.ActivityName),
            new SqlParameter("@t_Money",entity.t_Money),
            new SqlParameter("@isLock",entity.isLock),
            new SqlParameter("@isGetted",entity.isGetted),
            new SqlParameter("@createTime",entity.createTime),
             new SqlParameter("@isEnable",entity.isEnable)
         };
            return SQLHelper.ExecuteNonQuery(Config.EmoneyWeiXin, System.Data.CommandType.Text, sql, paras);
        }
    }
}
